﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Web
{
    public partial class WebTestPay : FromentWebCommon
    {
        public string cks = string.Empty;
        public string odate = string.Empty;
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            if (!Page.IsPostBack)
            {
                if (string.IsNullOrEmpty(Common.UICookie.ReadCookie("ClientUId")))
                {
                    Response.Write("<script>alert('请先登录！');window.location.href='default.aspx';</script>");
                }
                else
                {
                    if (Request.QueryString["Id"] != null)
                    {
                        cks = Request.QueryString["Id"];
                       
                    }
                    int cid = Convert.ToInt32(Common.UICookie.ReadCookie("ClientUId"));
                    var umodel = Common.SqlExption.GetList<Model.tb_user>().FirstOrDefault(c => c.Id.Equals(cid));
                    var times = 60;//一个订单60秒
                    var oid=cks.Split(',');
                    int myoid = Convert.ToInt32(oid[0]);
                    var omodel = Common.SqlExption.GetList<Model.tb_order>().FirstOrDefault(c => c.Id.Equals(myoid));
                    odate = omodel.pay_create_time.AddSeconds(times).ToString("yyyy-MM-dd HH:mm:ss");
                    
                }

            }
        }
    }
}